var myChart = echarts.init(document.getElementById("idx1"))
var option = {
      series: [
        {
          name: 'Pressure',
          type: 'gauge',
          detail: {
            formatter: '{value}'
          },
          data: [{
              value: 80,
              name: '当前速度'
            }],
        min: 20,
        max: 200,
        },
      ]
};
myChart.setOption(option);  
 
var myChart2 = echarts.init(document.getElementById("idx2"))
var option2 = {
    title: {
        text: '仪表盘-zzf',
    },
    series:{
        type:'gauge',
        data:[
            {value:50,name:'当前速度'}
        ],
        radius: '90%',
        min: 0,
        max: 200,
        title: {
            show: true,
            backgroundColor: 'yellow',
        },
        detail: {
            formatter:'{value}km/h',
            fontSize: 20,
        },
        axisLine: {
            lineStyle: {
                color: [
                    [0.2, '#fa0004'],
                    [0.6, '#007d00'],
                    [0.9, '#0000f8'],
                    [1, '#000000']
                  ]
            },
        },
    },
};
myChart2.setOption(option2) 
 
var mychart3 = echarts.init(document.getElementById("idx3"));

var option3 ={
    series:{
        type:'gauge',
        data:[{
            name: ' ',
            value: 0,
            detail:{
                show:false,
            },
        }],
        min:0,
        max:60,
        startAngle: 90,
        endAngle: -270,
        splitNumber: 12,
        axisLabel: {
            formatter: function(value){
                if(value==0){
                    return '';
                }else{
                    return value;
                }
            },
        },
    },
    title:{
        text:'时钟',
        subtext:'zzf',
    },
};
mychart3.setOption(option3);
setInterval(function(){
    var timeT = option3.series.data[0].value;
    timeT = (timeT + 1) % 60;
    option3.series.data[0].value = timeT;
    mychart3.setOption(option3);
},1000);